#include "sdl_mutex.h"
#include <SDL/SDL_mutex.h>

using namespace Commands;
using namespace Commands::Core;

SDL_ThreadingPolicy::SDL_ThreadingPolicy()
: mutex(SDL_CreateMutex())
{}
//-----------------------------------------------------------------------------
SDL_ThreadingPolicy::~SDL_ThreadingPolicy()
{
    SDL_DestroyMutex(mutex);
}
//-----------------------------------------------------------------------------
void SDL_ThreadingPolicy::Acquire(void) const
{
    SDL_LockMutex(mutex);
}
//-----------------------------------------------------------------------------
void SDL_ThreadingPolicy::Release(void) const
{
    SDL_UnlockMutex(mutex);
}
//-----------------------------------------------------------------------------
